# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models


class Migration(SchemaMigration):

    def forwards(self, orm):
        # Adding model 'CelebrateList'
        db.create_table('goodies_celebratelist', (
            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
            ('real_date', self.gf('django.db.models.fields.DateField')()),
            ('shown_date', self.gf('django.db.models.fields.CharField')(max_length=30)),
            ('name', self.gf('django.db.models.fields.CharField')(max_length=200)),
        ))
        db.send_create_signal('goodies', ['CelebrateList'])

        # Adding M2M table for field books on 'CelebrateList'
        db.create_table('goodies_celebratelist_books', (
            ('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True)),
            ('celebratelist', models.ForeignKey(orm['goodies.celebratelist'], null=False)),
            ('book', models.ForeignKey(orm['goodies.book'], null=False))
        ))
        db.create_unique('goodies_celebratelist_books', ['celebratelist_id', 'book_id'])

        # Adding model 'Customer'
        db.create_table('goodies_customer', (
            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
            ('fio', self.gf('django.db.models.fields.CharField')(max_length=140, blank=True)),
            ('phone', self.gf('django.db.models.fields.CharField')(max_length=12)),
            ('email', self.gf('django.db.models.fields.CharField')(max_length=140)),
            ('passw', self.gf('django.db.models.fields.CharField')(max_length=12)),
            ('address', self.gf('django.db.models.fields.TextField')()),
            ('pay_type', self.gf('django.db.models.fields.SmallIntegerField')(default=0)),
            ('is_vip', self.gf('django.db.models.fields.NullBooleanField')(null=True, blank=True)),
            ('comment', self.gf('django.db.models.fields.TextField')(null=True, blank=True)),
            ('date', self.gf('django.db.models.fields.DateField')(auto_now=True, null=True, blank=True)),
        ))
        db.send_create_signal('goodies', ['Customer'])

        # Adding model 'Company'
        db.create_table('goodies_company', (
            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
            ('company_name', self.gf('django.db.models.fields.CharField')(max_length=1024)),
            ('company_address', self.gf('django.db.models.fields.CharField')(max_length=1024)),
            ('bank_name', self.gf('django.db.models.fields.CharField')(max_length=1024)),
            ('bik_number', self.gf('django.db.models.fields.CharField')(max_length=1024)),
            ('accaunt_two', self.gf('django.db.models.fields.IntegerField')()),
            ('okpo_number', self.gf('django.db.models.fields.IntegerField')()),
            ('okved_number', self.gf('django.db.models.fields.IntegerField')()),
            ('inn_number', self.gf('django.db.models.fields.IntegerField')()),
            ('acaunt_one', self.gf('django.db.models.fields.IntegerField')()),
        ))
        db.send_create_signal('goodies', ['Company'])

        # Adding model 'Customer_Address'
        db.create_table('goodies_customer_address', (
            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
            ('customer', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['goodies.Customer'])),
            ('name', self.gf('django.db.models.fields.CharField')(max_length=1000)),
            ('phone', self.gf('django.db.models.fields.CharField')(max_length=20)),
            ('fax', self.gf('django.db.models.fields.CharField')(max_length=20)),
            ('address', self.gf('django.db.models.fields.TextField')()),
            ('comment', self.gf('django.db.models.fields.TextField')(blank=True)),
        ))
        db.send_create_signal('goodies', ['Customer_Address'])

        # Adding model 'Order'
        db.create_table('goodies_order', (
            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
            ('date', self.gf('django.db.models.fields.DateField')(auto_now=True, blank=True)),
            ('status', self.gf('django.db.models.fields.SmallIntegerField')(default=0)),
            ('total_price', self.gf('django.db.models.fields.IntegerField')(max_length=20)),
            ('fio', self.gf('django.db.models.fields.CharField')(max_length=20)),
            ('customer', self.gf('django.db.models.fields.related.OneToOneField')(blank=True, related_name='order', unique=True, null=True, to=orm['goodies.Customer'])),
            ('phone', self.gf('django.db.models.fields.CharField')(max_length=12)),
            ('email', self.gf('django.db.models.fields.CharField')(max_length=140)),
            ('address', self.gf('django.db.models.fields.TextField')()),
            ('pay_type', self.gf('django.db.models.fields.SmallIntegerField')(default=0)),
            ('is_vip', self.gf('django.db.models.fields.NullBooleanField')(null=True, blank=True)),
            ('comment', self.gf('django.db.models.fields.TextField')(null=True, blank=True)),
        ))
        db.send_create_signal('goodies', ['Order'])

        # Adding model 'Category'
        db.create_table('goodies_category', (
            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
            ('name', self.gf('django.db.models.fields.CharField')(max_length=50)),
            ('legacy_url', self.gf('django.db.models.fields.CharField')(max_length=100, blank=True)),
            ('legacy_id', self.gf('django.db.models.fields.SmallIntegerField')(max_length=3, blank=True)),
            ('parent', self.gf('mptt.fields.TreeForeignKey')(blank=True, related_name='children', null=True, to=orm['goodies.Category'])),
            ('lft', self.gf('django.db.models.fields.PositiveIntegerField')(db_index=True)),
            ('rght', self.gf('django.db.models.fields.PositiveIntegerField')(db_index=True)),
            ('tree_id', self.gf('django.db.models.fields.PositiveIntegerField')(db_index=True)),
            ('level', self.gf('django.db.models.fields.PositiveIntegerField')(db_index=True)),
        ))
        db.send_create_signal('goodies', ['Category'])

        # Adding model 'Book'
        db.create_table('goodies_book', (
            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
            ('author', self.gf('django.db.models.fields.CharField')(max_length=1000, null=True, blank=True)),
            ('name', self.gf('django.db.models.fields.CharField')(max_length=1000, null=True, blank=True)),
            ('place', self.gf('django.db.models.fields.CharField')(max_length=100, null=True, blank=True)),
            ('publisher', self.gf('django.db.models.fields.CharField')(max_length=1000, null=True, blank=True)),
            ('year', self.gf('django.db.models.fields.CharField')(max_length=10, null=True, blank=True)),
            ('pages', self.gf('django.db.models.fields.CharField')(max_length=1000, null=True, blank=True)),
            ('size', self.gf('django.db.models.fields.CharField')(max_length=1000, null=True, blank=True)),
            ('cover', self.gf('django.db.models.fields.CharField')(max_length=1000, null=True, blank=True)),
            ('description', self.gf('django.db.models.fields.TextField')(null=True, blank=True)),
            ('safety', self.gf('django.db.models.fields.TextField')(null=True, blank=True)),
            ('price', self.gf('django.db.models.fields.IntegerField')(null=True, blank=True)),
            ('legacy_id', self.gf('django.db.models.fields.IntegerField')(null=True, blank=True)),
            ('status', self.gf('django.db.models.fields.SmallIntegerField')(null=True, blank=True)),
            ('storage', self.gf('django.db.models.fields.SmallIntegerField')(null=True, blank=True)),
            ('date', self.gf('django.db.models.fields.DateField')(null=True, blank=True)),
            ('resolution', self.gf('django.db.models.fields.SmallIntegerField')(null=True, blank=True)),
            ('owner', self.gf('django.db.models.fields.SmallIntegerField')(null=True, blank=True)),
            ('order', self.gf('django.db.models.fields.related.ForeignKey')(blank=True, related_name='books', null=True, to=orm['goodies.Order'])),
            ('basket', self.gf('django.db.models.fields.related.ForeignKey')(related_name='basket', null=True, to=orm['goodies.Customer'])),
            ('customer', self.gf('django.db.models.fields.related.ForeignKey')(related_name='books', null=True, to=orm['goodies.Customer'])),
        ))
        db.send_create_signal('goodies', ['Book'])

        # Adding M2M table for field categories on 'Book'
        db.create_table('goodies_book_categories', (
            ('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True)),
            ('book', models.ForeignKey(orm['goodies.book'], null=False)),
            ('category', models.ForeignKey(orm['goodies.category'], null=False))
        ))
        db.create_unique('goodies_book_categories', ['book_id', 'category_id'])

        # Adding model 'Picture'
        db.create_table('goodies_picture', (
            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
            ('book', self.gf('django.db.models.fields.related.ForeignKey')(related_name='pictures', to=orm['goodies.Book'])),
            ('image', self.gf('sorl.thumbnail.fields.ImageField')(max_length=100, blank=True)),
        ))
        db.send_create_signal('goodies', ['Picture'])


    def backwards(self, orm):
        # Deleting model 'CelebrateList'
        db.delete_table('goodies_celebratelist')

        # Removing M2M table for field books on 'CelebrateList'
        db.delete_table('goodies_celebratelist_books')

        # Deleting model 'Customer'
        db.delete_table('goodies_customer')

        # Deleting model 'Company'
        db.delete_table('goodies_company')

        # Deleting model 'Customer_Address'
        db.delete_table('goodies_customer_address')

        # Deleting model 'Order'
        db.delete_table('goodies_order')

        # Deleting model 'Category'
        db.delete_table('goodies_category')

        # Deleting model 'Book'
        db.delete_table('goodies_book')

        # Removing M2M table for field categories on 'Book'
        db.delete_table('goodies_book_categories')

        # Deleting model 'Picture'
        db.delete_table('goodies_picture')


    models = {
        'goodies.book': {
            'Meta': {'object_name': 'Book'},
            'author': ('django.db.models.fields.CharField', [], {'max_length': '1000', 'null': 'True', 'blank': 'True'}),
            'basket': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'basket'", 'null': 'True', 'to': "orm['goodies.Customer']"}),
            'categories': ('django.db.models.fields.related.ManyToManyField', [], {'blank': 'True', 'related_name': "'books'", 'null': 'True', 'symmetrical': 'False', 'to': "orm['goodies.Category']"}),
            'cover': ('django.db.models.fields.CharField', [], {'max_length': '1000', 'null': 'True', 'blank': 'True'}),
            'customer': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'books'", 'null': 'True', 'to': "orm['goodies.Customer']"}),
            'date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}),
            'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'legacy_id': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}),
            'name': ('django.db.models.fields.CharField', [], {'max_length': '1000', 'null': 'True', 'blank': 'True'}),
            'order': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'books'", 'null': 'True', 'to': "orm['goodies.Order']"}),
            'owner': ('django.db.models.fields.SmallIntegerField', [], {'null': 'True', 'blank': 'True'}),
            'pages': ('django.db.models.fields.CharField', [], {'max_length': '1000', 'null': 'True', 'blank': 'True'}),
            'place': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}),
            'price': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}),
            'publisher': ('django.db.models.fields.CharField', [], {'max_length': '1000', 'null': 'True', 'blank': 'True'}),
            'resolution': ('django.db.models.fields.SmallIntegerField', [], {'null': 'True', 'blank': 'True'}),
            'safety': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
            'size': ('django.db.models.fields.CharField', [], {'max_length': '1000', 'null': 'True', 'blank': 'True'}),
            'status': ('django.db.models.fields.SmallIntegerField', [], {'null': 'True', 'blank': 'True'}),
            'storage': ('django.db.models.fields.SmallIntegerField', [], {'null': 'True', 'blank': 'True'}),
            'year': ('django.db.models.fields.CharField', [], {'max_length': '10', 'null': 'True', 'blank': 'True'})
        },
        'goodies.category': {
            'Meta': {'object_name': 'Category'},
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'legacy_id': ('django.db.models.fields.SmallIntegerField', [], {'max_length': '3', 'blank': 'True'}),
            'legacy_url': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}),
            'level': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}),
            'lft': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}),
            'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}),
            'parent': ('mptt.fields.TreeForeignKey', [], {'blank': 'True', 'related_name': "'children'", 'null': 'True', 'to': "orm['goodies.Category']"}),
            'rght': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}),
            'tree_id': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'})
        },
        'goodies.celebratelist': {
            'Meta': {'object_name': 'CelebrateList'},
            'books': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'celebrities'", 'symmetrical': 'False', 'to': "orm['goodies.Book']"}),
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'name': ('django.db.models.fields.CharField', [], {'max_length': '200'}),
            'real_date': ('django.db.models.fields.DateField', [], {}),
            'shown_date': ('django.db.models.fields.CharField', [], {'max_length': '30'})
        },
        'goodies.company': {
            'Meta': {'object_name': 'Company'},
            'acaunt_one': ('django.db.models.fields.IntegerField', [], {}),
            'accaunt_two': ('django.db.models.fields.IntegerField', [], {}),
            'bank_name': ('django.db.models.fields.CharField', [], {'max_length': '1024'}),
            'bik_number': ('django.db.models.fields.CharField', [], {'max_length': '1024'}),
            'company_address': ('django.db.models.fields.CharField', [], {'max_length': '1024'}),
            'company_name': ('django.db.models.fields.CharField', [], {'max_length': '1024'}),
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'inn_number': ('django.db.models.fields.IntegerField', [], {}),
            'okpo_number': ('django.db.models.fields.IntegerField', [], {}),
            'okved_number': ('django.db.models.fields.IntegerField', [], {})
        },
        'goodies.customer': {
            'Meta': {'object_name': 'Customer'},
            'address': ('django.db.models.fields.TextField', [], {}),
            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
            'date': ('django.db.models.fields.DateField', [], {'auto_now': 'True', 'null': 'True', 'blank': 'True'}),
            'email': ('django.db.models.fields.CharField', [], {'max_length': '140'}),
            'fio': ('django.db.models.fields.CharField', [], {'max_length': '140', 'blank': 'True'}),
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'is_vip': ('django.db.models.fields.NullBooleanField', [], {'null': 'True', 'blank': 'True'}),
            'passw': ('django.db.models.fields.CharField', [], {'max_length': '12'}),
            'pay_type': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}),
            'phone': ('django.db.models.fields.CharField', [], {'max_length': '12'})
        },
        'goodies.customer_address': {
            'Meta': {'object_name': 'Customer_Address'},
            'address': ('django.db.models.fields.TextField', [], {}),
            'comment': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
            'customer': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['goodies.Customer']"}),
            'fax': ('django.db.models.fields.CharField', [], {'max_length': '20'}),
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'name': ('django.db.models.fields.CharField', [], {'max_length': '1000'}),
            'phone': ('django.db.models.fields.CharField', [], {'max_length': '20'})
        },
        'goodies.order': {
            'Meta': {'object_name': 'Order'},
            'address': ('django.db.models.fields.TextField', [], {}),
            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
            'customer': ('django.db.models.fields.related.OneToOneField', [], {'blank': 'True', 'related_name': "'order'", 'unique': 'True', 'null': 'True', 'to': "orm['goodies.Customer']"}),
            'date': ('django.db.models.fields.DateField', [], {'auto_now': 'True', 'blank': 'True'}),
            'email': ('django.db.models.fields.CharField', [], {'max_length': '140'}),
            'fio': ('django.db.models.fields.CharField', [], {'max_length': '20'}),
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'is_vip': ('django.db.models.fields.NullBooleanField', [], {'null': 'True', 'blank': 'True'}),
            'pay_type': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}),
            'phone': ('django.db.models.fields.CharField', [], {'max_length': '12'}),
            'status': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}),
            'total_price': ('django.db.models.fields.IntegerField', [], {'max_length': '20'})
        },
        'goodies.picture': {
            'Meta': {'object_name': 'Picture'},
            'book': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'pictures'", 'to': "orm['goodies.Book']"}),
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'image': ('sorl.thumbnail.fields.ImageField', [], {'max_length': '100', 'blank': 'True'})
        }
    }

    complete_apps = ['goodies']